package com.redwine.app.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.redwine.app.R;

/**
 * 加载空白页view
 * 作者：gassion on 17/4/4 17:17
 * 最可怕的敌人，就是没有坚强的信念。
 */

public class EmptyView extends LinearLayout {

    @ViewInject(R.id.empty_top_layout)
    public LinearLayout emptyTopLayout;
    @ViewInject(R.id.empty_error_bottom_image)
    public ImageView emptyErrorBottomImage;

    public EmptyView(Context context) {
        super(context);
    }

    public EmptyView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public EmptyView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        ViewUtils.inject(this, this);
    }

    public void bind() {
        emptyTopLayout.setVisibility(INVISIBLE);
        emptyErrorBottomImage.setVisibility(GONE);
        ViewUtils.inject(this, this);
    }

    public void show() {
        emptyTopLayout.setVisibility(VISIBLE);
        emptyErrorBottomImage.setVisibility(GONE);
        ViewUtils.inject(this, this);
    }


}
